package com.zzq.demo.excel.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.zzq.demo.excel.BaseExcelListener;
import com.zzq.demo.excel.model.StringModel;

/**
 * @author : zhaoziqian
 * @description :
 * @date : 2019/7/1 9:13
 */
public class StringModelListener extends BaseExcelListener<StringModel> {

    public StringModelListener(Class<StringModel> clazz) {
        super(clazz);
    }

    @Override
    public void invoke(StringModel stringModel, AnalysisContext analysisContext) {
        if (!checkObjAllFieldsIsNull(stringModel)) {
            getDataList().add(stringModel);
        }
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        System.out.println(getDataList());
    }

}
